<template>
	<view class="container bg-main">
		<view class="flex p-5">
			<!-- 头像 -->
			<view @click="chooseAvatar">
				<image :src="user.avatar|| '/static/gift/10.png'" class="rounded-circle avatar"></image>
			</view>
			<!-- 账号金币 -->
			<view class="flex flex-column p-2">
				<text class="font-lg text-white">{{user.username}}</text>
				<view class="flex">
					<text class="font-md text-white">金币</text>
					<text class="font-md text-white" style="margin-left: 10rpx;">{{user.coin}}</text>
				</view>
			</view>
		</view>
		<!-- 卡片高度 -->
		<view class="card bg-white flex flex-wrap justify-around align-center">
			<view class="m-2" style="width: 120rpx;height: 120rpx;" v-for="item in list" hover-class="bg-light">
				<view>
					<image :src="item.src" style="width: 100rpx;height: 100rpx;top:10rpx;left:10rpx"></image>
				</view>
				<view class="flex justify-center align-end mt-1">
					<text class="font-sm text-secondary">{{item.content}}</text>
				</view>
			</view>
		</view>
		<view class="mt-2"></view>
		<view class="card bg-white" style="width: 700rpx;height: 100rpx;padding-bottom:0rpx">
			<f-list-item icon="icon-wode-xiaoxi" title="我的消息">
				<text class="font-sm text-muted text-main">0</text>
			</f-list-item>
		</view>
		<view class="mt-2"></view>
		<view class="card bg-white" style="width: 700rpx;height: 300rpx;padding-bottom:0rpx">
			<f-list-item title="我的关注" icon="icon-a-tianjiaguanzhuguanzhu">
				<text class="font-sm text-muted">0</text>
			</f-list-item>
			<f-list-item title="我的粉丝" icon="icon-wodefensi">
				<text class="font-sm text-muted">0</text>
			</f-list-item>
			<f-list-item title="我的黑名单" icon="icon-heimingdan">
				<text class="font-sm text-danger">0</text>
			</f-list-item>
		</view>

	</view>
</template>

<script>
	import fListItem from '@/component/common/f-list-item/f-list-item.vue';
	import {
		mapState
	} from 'vuex'
	export default {
		components: {
			fListItem
		},
		data() {
			return {
				list: [{
						content: '修改信息',
						src: require('@/static/my-detail/bianjiziliao.png')
					},
					{
						content: '我的等级',
						src: require('@/static/my-detail/wodedengji.png')
					},
					{
						content: '收益',
						src: require('@/static/my-detail/shouyi.png')
					},
					{
						content: '礼物明细',
						src: require('@/static/my-detail/liwu.png')
					},
					{
						content: '广告招商',
						src: require('@/static/my-detail/guanggao.png')
					},
					{
						content: '禁言',
						src: require('@/static/my-detail/jinyan.png')
					},
					{
						content: '存取款',
						src: require('@/static/my-detail/cunqukuan.png')
					},
					{
						content: '联系我们',
						src: require('@/static/my-detail/lianxiwomen.png')
					},
				]
			}
		},
		onShow() {
			this.$store.dispatch('getUserInfo')
			
		},
		computed: {
			...mapState(['user'])
		},
		methods: {
			chooseAvatar() {
				uni.chooseImage({
					count: 1,
				})
			}
		}
	}
</script>

<style>
	.container {
		height: 300rpx;
		margin: 0;
		padding: 0;
	}

	.avatar {
		height: 150rpx;
		width: 150rpx;
	}

	.card {
		position: relative;
		height: 340rpx;
		width: 700rpx;
		margin: 0 25rpx;
		padding-bottom: 20rpx;
		border-radius: 20rpx;
		box-shadow: 0 0 12rpx #D5D5D5;
	}
</style>
